package com.pbd.client;

import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RadioButton;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.VerticalPanel;

public class LeadCreationScreen extends Composite{

	public LeadCreationScreen() {
		super();
		init();
		
	}

	private void init() {
		
		VerticalPanel mainPanel = new VerticalPanel();
		
		FlexTable basicFlexTable = new FlexTable();
		
		mainPanel.add(basicFlexTable);
		
		Label memberTypeLabel = new Label("Do you want to edit exisiting lead ? ");
		
		RadioButton yesRadio = new RadioButton("exisitingLead");
		yesRadio.setText("Yes");
		
		RadioButton noRadio = new RadioButton("exisitingLead");
		noRadio.setText("No");
		noRadio.setValue(true);
		basicFlexTable.setWidget(0, 0,memberTypeLabel);
		
		HorizontalPanel radioPanel = new HorizontalPanel();
		radioPanel.setSpacing(2);
		radioPanel.add(yesRadio);
		radioPanel.add(noRadio);
		
		basicFlexTable.setWidget(0,1,radioPanel);
		
		Label refLabel = new Label("Reference No ");
		
		TextBox refNo = new TextBox();
		
		basicFlexTable.setWidget(1, 0,refLabel);
		basicFlexTable.setWidget(1, 1,refNo);

		
		Label sourceLabel = new Label("Lead source ");
		
		PbdListBox leadSource = new PbdListBox("250px");
		
		basicFlexTable.setWidget(2, 0,sourceLabel);
		basicFlexTable.setWidget(2, 1,leadSource);
		
		Label statusLabel = new Label("Lead status ");
		
		PbdListBox leadStatus = new PbdListBox("250px");
		
		basicFlexTable.setWidget(3, 0,statusLabel);
		basicFlexTable.setWidget(3, 1,leadStatus);
		
		createMemberDetails(mainPanel);
		
		initWidget(mainPanel);
		/**

Contact Widget (make it as generic, already we used in the enquiry form, it might use in many places)

Media Widget (make it as generic)

Conversation
-------------------

Conversation Type  -  Combo (Email/Direct/Snail Mail)

Conversation Description - Text Area

Conversation Date - Date Picker (Default current date) 

If user select type email, give the provision to send the email to the particular member. suppose selected member doesn't have email id, don't show the email type in the combo
		 * */
		
	}

	private void createMemberDetails(VerticalPanel mainPanel) {
		
		FlexTable memberDetailsFlex = new FlexTable();	
		
		Label nameLabel= new Label("Name");
		
		TextBox nameBox = new TextBox();
		
		memberDetailsFlex.setWidget(0, 0,nameLabel);
		memberDetailsFlex.setWidget(0, 1,nameBox);
		
		Label businessCategoryLabel= new Label("Business category");
		
		PbdListBox busCategory = new PbdListBox("250px");
		
		memberDetailsFlex.setWidget(1, 0,businessCategoryLabel);
		memberDetailsFlex.setWidget(1, 1,busCategory);
		
		Label addressLabel= new Label("Address");
		
		TextBox address = new TextBox();
		
		memberDetailsFlex.setWidget(2, 0,addressLabel);
		memberDetailsFlex.setWidget(2, 1,address);
		
		Label areaLabel= new Label("Area");
		
		TextBox area = new TextBox();
		
		memberDetailsFlex.setWidget(3, 0,areaLabel);
		memberDetailsFlex.setWidget(3, 1,area);	
		
		Label cityLabel= new Label("City");
		
		TextBox city = new TextBox();
		
		memberDetailsFlex.setWidget(4, 0,cityLabel);
		memberDetailsFlex.setWidget(4, 1,city);	
		
		Label stateLabel= new Label("State");
		
		TextBox state = new TextBox();
		
		memberDetailsFlex.setWidget(5, 0,stateLabel);
		memberDetailsFlex.setWidget(5, 1,state);
		
		Label countryLabel= new Label("Country");
		
		TextBox country = new TextBox();
		
		memberDetailsFlex.setWidget(6, 0,countryLabel);
		memberDetailsFlex.setWidget(6, 1,country);	
		
		Label pinLabel= new Label("Pin code");
		
		TextBox pincode = new TextBox();
		
		memberDetailsFlex.setWidget(7, 0,pinLabel);
		memberDetailsFlex.setWidget(7, 1,pincode);	
		
		mainPanel.add(memberDetailsFlex);
		//mainPanel.setWidget(mainPanel.getRowCount(), 0, memberDetailsFlex);
		
	}

}
